using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICCreditObjectEntryMap : EntityTypeConfiguration<ICCreditObjectEntry>
    {
        public ICCreditObjectEntryMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FInterID, t.FItemID });

            // Properties
            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("ICCreditObjectEntry");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FAuxTaxPrice).HasColumnName("FAuxTaxPrice");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
        }
    }
}
